projects_data <- c(
  "Perl", "1_perl", "Perforce","GIT",
  "kate", "2_kate", "CSV","GIT",
  "koffice", "3_koffice", "CSV","GIT",
  "nautilus", "4_nautilus", "SVN","GIT",
  "postgresql", "5_postgresql", "SVN","GIT",
  "python", "6_python", "SVN","HG",
  "octave", "7_octave", "SVN","HG",
  "netbeans", "8_netbeans", "CVS","HG")

projects_total = 8

projects <- matrix(projects_data, 
                   nrow   = projects_total, 
                   ncol   = 4,
                   byrow  = TRUE)

changes <- matrix(nrow   = projects_total, 
                      ncol   = 3,
                      byrow  = TRUE)

for (i in 1:projects_total) {
  
  project <- read.csv(file = paste(projects[i,2], ".csv", sep = ""),
                      head = TRUE,
                      sep=",")
  
  boxplot( project$BEFORE, project$AFTER, 
           horizontal = TRUE,
           names      = c(projects[i,3],projects[i,4]),
           main       = paste("Changes per month - ", projects[i,1], sep = ""),                  
           xlab       = "Number of changes per month")
 
  dev.copy(png, paste(projects[i,2], ".png", sep = ""))
  
  dev.off()
  
  changes[i,1] <- projects[i,1]
  changes[i,2] <- colMeans(matrix(project$BEFORE), na.rm = TRUE)
  changes[i,3] <- colMeans(matrix(project$AFTER), na.rm = TRUE)
  
}

changes